[PATCH] lib: Preserve errno in our malloc() and free() wrappers
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Thu, 26 Feb 2026 10:29:12 +0000 (12:29 +0200)
committerNoah Meyerhans <noahm@debian.org>
Thu, 5 Mar 2026 01:08:14 +0000 (20:08 -0500)
commit43d330d64a81d99f4ad7f5e92626c9922654402c
tree4938b8777d080042ec6cfff91e7c35a73184d16e
parent5050e2fe883232a1b1c14ab2c69f021287e28656
[PATCH] lib: Preserve errno in our malloc() and free() wrappers

Various places assume that e.g. t_strdup_printf() calls and such don't
modify errno. But because they internally call malloc() or calloc(), this
isn't actually guaranteed now and it can happen at least with newer glibc
versions. Explicitly preserve the errno for these calls where it might
be a problem.

Gbp-Pq: Name lib_Preserve_errno_in_our_malloc_and_free_wrappers.patch
src/lib/data-stack.c
src/lib/mempool-allocfree.c
src/lib/mempool-alloconly.c
src/lib/mempool-system.c